#ifndef RESOURCEWINDOW_H
#define RESOURCEWINDOW_H

#include <QMainWindow>

#include <QSplitter>
#include <QDialog>
#include <QLabel>
#include <QLineEdit>
#include <QMap>
#include <QPushButton>

class AbstractCore;
class StyledBar;

class QResourceTopLevelWidget;
class QResourceFileWidget;
class ImageView;
class QActionToolBar;
class QResourceInterface;


class QAddImageFolderDialog: public QDialog
{
    Q_OBJECT
public:
    QAddImageFolderDialog(QResourceInterface *interface,QWidget* parent=0);

    int getRet();
    QString getFolder();
protected slots:
    void onCancel();
    void onAdd();
protected:
    QResourceInterface  *m_resource;
    int m_ret;
    QLineEdit   *m_edit;
};

class ResourceWindow : public QMainWindow
{
    Q_OBJECT
public:
    explicit ResourceWindow(AbstractCore *core,QWidget *parent = 0);
    
signals:
    
public slots:
    void    addImageFolder();
    void    removeFolder();

    void    addImage();
    void    removeImage();

    void    toplevelSelectChange();

    void    resourceSelectChanged();
protected:
    AbstractCore        *m_core;
    QSplitter           *m_splitter;

    QResourceTopLevelWidget *m_toplevel;
    StyledBar            *m_toplevelBar;
    QActionToolBar          *m_topLevelToolBar;

    QResourceFileWidget  *m_fileWidget;
    StyledBar            *m_fileWidgetBar;
    QActionToolBar       *m_fileWidgetToolBar;

    ImageView              *m_imageView;
    StyledBar               *m_imageViewBar;
    QActionToolBar          *m_imageViewToolBar;


    QMap<QString,QAction*>  m_actions;
};

#endif // RESOURCEWINDOW_H
